<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>基本信息</title>
<link type="text/css" href="../js/jDialog/jDialog.css" rel="stylesheet" >
<script type="text/javascript" src="../js/jDialog/jquery.dialog.js"></script>
<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
<link type="text/css" href="../css/Info.css" rel="stylesheet" >
<script src="../js/selectHome/Area.js" type="text/javascript"></script>
<script type="text/javascript" src="../js/form/jquery.form.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	initComplexArea('seachprov', 'seachcity', 'seachdistrict', area_array, sub_array, '44', '0', '0');
	var userObj =window.userObj;
	$("#userDTO\\.userId").val(userObj[0].userId);
	$("#userDTO\\.userNickName").val(userObj[0].userNickName);
	$("#userDTO\\.userLoginName").html(userObj[0].userLoginName);
	$("#userDTO\\.userNation").val(userObj[0].userNation);
	$("#userDTO\\.userBirthday").val(userObj[0].userBirthday);
	$("#userDTO\\.homePlace").val(userObj[0].homePlace);
	$("#jiguan").html(userObj[0].homePlace)
});
$.getHome = function(){
	var address;
	var province = $("#seachprov").find("option:selected").text();
	var city = $("#seachcity").find("option:selected").text();
	var county = $("#seachdistrict").find("option:selected").text();
	address = province+"-"+city+"-"+county;
	$("#userDTO\\.homePlace").val(address);
};
$.saveInfo = function(){
	var options = {
		type : 'post',
		dataType : 'text',
		url : '../user/updateUserInfo.action',
		success : function(msg) {
			if(msg==1){
				var dialog = jDialog.dialog({
					title : '提示信息',
					content : '信息修改成功！'
				});
			}
			else{
				var dialog = jDialog.dialog({
					title : '提示信息',
					content : '信息修改失败！'
				});
			}
		}
	};
	$("#updateForm").ajaxSubmit(options);
	window.location.reload();
};
</script>
</head>
<body>
<div class="mineInfo">
<span id="info1">我的信息 &nbsp;PROFILE</span>
<hr style="height:1px;border:none;border-top:1px solid #555555;" />
</div>
<div id="fromContent">
<form name="updateForm" id="updateForm" method="post">
<ul class="nopoint">
<li><label for="userDTO.userNickName">昵称:</label><input type="text" id="userDTO.userNickName" name="userDTO.userNickName"></li>
<li><label for="userDTO.userLoginName">用户名:</label><span id="userDTO.userLoginName"></span></li>
<li><label for="userDTO.userBirthday">生日:</label><input type="text" id="userDTO.userBirthday" name="userDTO.userBirthday"> <span style="font-size:14px;">请以<a style="color:#838B83">1995-08-15</a> 的格式填写</span></li>
<li><label for="userDTO.userNation">民族:</label><input type="text" id="userDTO.userNation" name="userDTO.userNation"></li>
<li><label >籍贯:</label><select style="margin-left:30px;" id="seachprov" name="seachprov" onChange="changeComplexProvince(this.value, sub_array, 'seachcity', 'seachdistrict');"></select>&nbsp;&nbsp;
<select id="seachcity" name="homecity" onChange="changeCity(this.value,'seachdistrict','seachdistrict');"></select>
<span id="seachdistrict_div"><select id="seachdistrict" name="seachdistrict" onChange="$.getHome()"></select></span></li>
<li><span style="font-size:14px;">您的籍贯是 <a id="jiguan" style="color:#838B83"></a>如需修改请重新选择</span></li>
<li><input type="button" value="保 存" onclick="$.saveInfo()"/></li>
</ul>
<!--隐藏传值 -->
<input type="hidden" value="" name="userDTO.homePlace" id="userDTO.homePlace"/>
<input type="hidden" value="" name="userDTO.userId" id="userDTO.userId"/>
</form>
</div>
</body>
</html>